Close
dtSearch Engine API for .NET Framework 2.x-4.x 2023.02
IndexJob::IsThreadDone Method

Checks whether an IndexJob started using ExecuteInThread is done, and also gets information on the state of the index update.

public bool IsThreadDone( int waitTimeMillis, ref IndexProgressInfo status );
Parameters
Description
waitTimeMillis
Number of milliseconds to wait of if the thread is not done.
status
Structure to update with the current state of the index update (can be null).

True if the thread is done, or false if the thread is still running.

An application that loops calling IsThreadDone() should call Sleep() between calls to allow the indexing thread to run. Otherwise a high percentage if CPU resources will be spent just processing IsThreadDone calls.  

If waitTimeMillis is greater than zero, IsThreadDone will automatically wait up to waitTimeMillis milliseconds for the thread to complete before returning false.